package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReturnsTheArgumentCastToTypeTInAnUnsafeWay {
	public static void main(String[] argv) {
		Object[] a = new String[]{"1", "abc", "level", null,
				"www.tah1986.com", "asdf 123"};
		System.out.println(java.util.Arrays.toString(unsafeCastArray(a)));
	}

	@SuppressWarnings("unchecked")
	private static <T> T[] unsafeCastArray(Object[] a) {
		return (T[]) a;
	}
}
